package com.ys.basebindinggdemo.ui.home

import android.content.Context
import android.view.ViewGroup
import android.widget.TextView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.DataBindingHolder
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.ys.basebindinggdemo.R
import com.ys.basebindinggdemo.databinding.ItemHomeDeviceBinding


class HomeDeviceAdapter :
    BaseQuickAdapter<String, DataBindingHolder<ItemHomeDeviceBinding>>() {
    override fun onBindViewHolder(
        holder: DataBindingHolder<ItemHomeDeviceBinding>,
        position: Int,
        item: String?
    ) {
        holder.binding.apply {
            tvDeviceName.text=item
        }

    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): DataBindingHolder<ItemHomeDeviceBinding> {

        return DataBindingHolder(R.layout.item_home_device,parent)
    }


}